package com.cie2.janji.services;

import java.util.List;

import org.hibernate.Session;

import com.cie2.janji.entities.EntityRoleInTime;

public class EntityRoleInTimeService {

	private Session session;
	
	public EntityRoleInTimeService(Session session) {
		this.session = session;
	}
	
	public void add(EntityRoleInTime roleInTime) {
		session.persist(roleInTime);
		session.flush();
	}
	
	public List getAll() {
		return session.createCriteria(EntityRoleInTime.class).list();
	}

	public EntityRoleInTime load(Long id) {
		return (EntityRoleInTime) session.load(EntityRoleInTime.class, id);
	}
}
